<template>
  <div>
      <h1>注册</h1>
        <p>用户名: <input type="text" v-model="username"></p>
        <p>密码: <input type="text" v-model="password"></p>
        <p><button @click="login">登录</button></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return {
            username:'',
            password:''
        
        };
    },
    methods:{
        login(){
            axios.post('http://127.0.0.1:8000/zizhu/',{'username':this.username,'password':this.password}),then(res=>{
                console.log(res.data)
                if (res.data.code==200){
                    this.$router.push('/zizhu_list')
                }
            })
        }
        
    },
    created(){
        
    },
}

</script>
<style>
</style>